package com.zzh.tools;

public class StringJoinUtils {

    public static String joinToString (Object... str) {
        StringBuilder stringBuilder = new StringBuilder();
        for (int i = 0 ; i < str.length; i ++)
            stringBuilder.append(str[i]);
        return stringBuilder.toString();
    }

    public static String joinPartitionSrting (boolean start, boolean end, Object partition, Object... value) {
        StringBuilder stringBuilder = new StringBuilder();
        if (start) stringBuilder.append(partition);
        for (int i = 0 ; i < value.length; i++) {
            if (i == value.length - 1) {
                stringBuilder.append(value[i]);
                if (end) stringBuilder.append(partition);
            } else {
                stringBuilder.append(value[i]).append(partition);
            }
        }
        return stringBuilder.toString();
    }

}
